home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1993 November
/
JCSM Shareware Collection - 1993-11.iso
/
cl760
/
stat1j.lzh
/
SINSTALL.BAT
< prev
Wrap
DOS Batch File
|
1991-12-26
|
10KB
|
247 lines
REM --- SINSTALL.BAT -- INSTALLATION BATCH FILE FOR STATHELP
@ECHO OFF
CLS
IF %1!==! GOTO USAGE
IF %2!==! GOTO USAGE
IF %1==A: IF %1==%2 GOTO USAGE
IF %1==a: IF %1==%2 GOTO USAGE
IF %1==B: IF %1==%2 GOTO USAGE
IF %1==b: IF %1==%2 GOTO USAGE
IF %2==A: GOTO SPACE
IF %2==a: GOTO SPACE
IF %2==B: GOTO SPACE
IF %2==b: GOTO SPACE
GOTO CHK2DRIV
:SPACE
@ECHO
@ECHO YOU HAVE ELECTED TO INSTALL THE STATHELP PROGRAMS ON A
@ECHO FLOPPY-DISK DRIVE, %2.
@ECHO
@ECHO This is acceptable ONLY IF Drive %2 is A 3.5" Drive or a
@ECHO High Density 5.25" Drive, with at least 470K bytes of free space.
@ECHO If you haven't already done so, insert an empty FORMATTED
@ECHO diskette in Drive %2, and be sure the door is closed.
@ECHO Also be sure that the diskette is NOT WRITE-PROTECTED.
@ECHO
@ECHO Then press any key to continue
@ECHO (or press [CTRL] & [BREAK] keys, together, to ABORT the installation.)
PAUSE>NUL
:CHK2DRIV
@ECHO
@ECHO Checking Specified Drive to Install TO
@ECHO ECHO XXXX>%2\TEST.TXT
IF NOT EXIST %2\TEST.TXT GOTO BAD2DRIVE
DEL %2\TEST.TXT
@ECHO
@ECHO OK -- TO_Drive exists -- Continuing
IF %2==A: GOTO CHKFROM
IF %2==a: GOTO CHKFROM
IF %2==B: GOTO CHKFROM
IF %2==b: GOTO CHKFROM
IF %3!==! GOTO SHDIR
@ECHO
@ECHO Checking for existence of specified TO_Directory
@ECHO (Ignore a "File creation error" message, if it appears)
@ECHO ECHO XXXX>%2%3\TEST.TXT
IF EXIST %2%3\TEST.TXT DEL %2%3\TEST.TXT GOTO CHKFROM
@ECHO
@ECHO
@ECHO You have specified a directory, %3, that doesn't exist yet.
@ECHO It will now be created, unless you choose to ABORT the installation
@ECHO at this point. To ABORT, simultaneously press the [CTRL] and [BREAK]
@ECHO keys, then answer Y (Yes) when DOS queries, "Terminate batch job?"
@ECHO Otherwise, continue with the installation by pressing any other key.
PAUSE>NUL
@ECHO
@ECHO Proceeding to create %3 Directory on Drive %2
MD %2%3
@ECHO ECHO XXXX>%2%3\TEST.TXT
IF NOT EXIST %2%3\TEST.TXT GOTO BAD2DIR
DEL %2%3\TEST.TXT
@ECHO
@ECHO Directory %3 created on Drive %2
GOTO CHKFROM
:SHDIR
@ECHO
@ECHO No To_Directory name specified -- default \STATHELP will be created
@ECHO (Ignore a "File creation error" message, if it appears)
@ECHO ECHO XXXX>%2\STATHELP\TEST.TXT
IF EXIST %2\STATHELP\TEST.TXT DEL %2\STATHELP\TEST.TXT GOTO CHKFROM
MD %2\STATHELP
@ECHO ECHO XXXX>%2\STATHELP\TEST.TXT
IF NOT EXIST %2\STATHELP\TEST.TXT GOTO BAD2DIR
DEL %2\STATHELP\TEST.TXT
:CHKFROM
@ECHO
@ECHO Checking specified Drive to install FROM
IF NOT EXIST %1\SHZIPARC.EXE GOTO BADFROM
@ECHO
@ECHO OK -- Archive file SHZIPARC.EXE found on Drive %1
@ECHO
@ECHO Beginning installation -- The next series of messages will come from
@ECHO the self-executing archive file SHZIPARC.EXE
@ECHO
IF %2==A: GOTO TOFLOPPY
IF %2==a: GOTO TOFLOPPY
IF %2==B: GOTO TOFLOPPY
IF %2==b: GOTO TOFLOPPY
IF %3!==! %1SHZIPARC %2\STATHELP
IF %3!==! GOTO CHKDINST
%1SHZIPARC %2%3
IF NOT EXIST %2%3\WATSTAT.EXE GOTO ZIPERROR
IF NOT EXIST %2%3\WATSTAT.TXT GOTO ZIPERROR
IF NOT EXIST %2%3\WATSTAT.HLP GOTO ZIPERROR
IF NOT EXIST %2%3\WATSTAT.INX GOTO ZIPERROR
IF NOT EXIST %2%3\WATUT.EXE GOTO ZIPERROR
IF NOT EXIST %2%3\LOOKUP.EXE GOTO ZIPERROR
IF NOT EXIST %2%3\RANDO.EXE GOTO ZIPERROR
REM IF NOT EXIST %2%3\SHMANUAL.DOC GOTO ZIPERROR
GOTO ENJOY
:CHKDINST
IF NOT EXIST %2\STATHELP\WATSTAT.EXE GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\WATSTAT.TXT GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\WATSTAT.HLP GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\WATSTAT.INX GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\WATUT.EXE GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\LOOKUP.EXE GOTO ZIPERROR
IF NOT EXIST %2\STATHELP\RANDO.EXE GOTO ZIPERROR
REM IF NOT EXIST %2\STATHELP\SHMANUAL.DOC GOTO ZIPERROR
GOTO ENJOY
:TOFLOPPY
%1SHZIPARC %2
IF ERRORLEVEL 50 GOTO OOPS
IF NOT EXIST %2\WATSTAT.EXE GOTO ZIPERROR
IF NOT EXIST %2\WATSTAT.TXT GOTO ZIPERROR
IF NOT EXIST %2\WATSTAT.HLP GOTO ZIPERROR
IF NOT EXIST %2\WATSTAT.INX GOTO ZIPERROR
IF NOT EXIST %2\WATUT.EXE GOTO ZIPERR0R
IF NOT EXIST %2\LOOKUP.EXE GOTO ZIPERROR
IF NOT EXIST %2\RANDO.EXE GOTO ZIPERROR
REM IF NOT EXIST %2\SHMANUAL.DOC GOTO ZIPERROR
:ENJOY
@ECHO
@ECHO ************** INSTALLATION COMPLETED SUCCESSFULLY *******************
@ECHO
@ECHO FINAL NOTES:
@ECHO
@ECHO 1) A mini-manual for the STATHELP programs, called SHMANUAL.DOC, has
@ECHO been installed along with the program files. SHMANUAL.DOC is a text
@ECHO file, which you can read with any text editor or word processor.
@ECHO Or, make a hard copy of this file on your printer by typing:
@ECHO PRINT SHMANUAL.DOC
@ECHO from the DOS command line (after changing to the Drive and Directory
@ECHO where SHMANUAL has just been installed).
@ECHO
@ECHO 2) To run any of the STATHELP programs, first change to the Drive
@ECHO and Directory where they were just installed, and then type the name
@ECHO of the program you want to run: WATSTAT, LOOKUP, or RANDO.
@ECHO
@ECHO ************** WE TRUST THAT YOU'LL ENJOY STATHELP *******************
@ECHO
GOTO END
:BAD2DRIV
@ECHO
@ECHO
@ECHO DRIVE %2 COULD NOT BE ACCESSED & FILES COULD NOT BE COPIED TO IT.
@ECHO
@ECHO If this drive exists on your machine, the problem may be due
@ECHO to an error in typing the TO_Drive in the SINSTALL command.
@ECHO You must type a colon (:) after the drive letter, and there
@ECHO must be no space between the drive letter and the colon. For
@ECHO example, type A:, but not A : or not A without the colon.
@ECHO If you requested installation to a floppy drive, the drive door
@ECHO may be open, or the diskette may be write-protected or unformatted.
@ECHO Before running SINSTALL again, use the DIR command to confirm
@ECHO that the TO_Drive is indeed ready.
GOTO END
:BAD2DIR
@ECHO
@ECHO
@ECHO DIRECTORY YOU SPECIFIED, %3, COULD NOT BE CREATED
@ECHO OR FILES COULDN'T BE COPIED TO IT.
@ECHO
@ECHO The problem may be due to an error in typing the TO_Directory name in
@ECHO the SINSTALL command. You must precede all Directory Names with a
@ECHO backslash (\), not a slash (/). There must be no space between the
@ECHO backslash and Name and no blank spaces in the Name itself.
@ECHO Some correct examples: \STATHELP or \UTILS\STATHELP
@ECHO Some BAD examples: \ STATHELP or \STAT HELP or \UTILS \STATHELP
@ECHO The Name you specify must, of course, be a legitimate DOS directory
@ECHO name, with a maximum of 8 characters and no "forbidden" characters.
@ECHO
GOTO END
:BADFROM
@ECHO
@ECHO
@ECHO COULD NOT FIND OR READ THE STATHELP ARCHIVE FILE (SHZIPARC.EXE) ON DRIVE %1
@ECHO
@ECHO The problem may be due to an error in typing the FROM_Drive name in
@ECHO the SINSTALL command: you must type a colon (:) after the drive
@ECHO letter, and there must be no space between the drive letter and
@ECHO the colon. E.G., type A:, but not A : or A without the colon.
@ECHO If the drive name was typed properly, the problem may be due to
@ECHO changing diskettes or openning the drive door after you started
@ECHO the installation. Before trying again, use the DIR command to see
@ECHO if the archive file SHZIPARC.EXE is indeed where you think it is.
GOTO END
:ZIPERROR
@ECHO
@ECHO
@ECHO AN ERROR OCCURRED IN THE UN-ARCHIVING PROCESS
@ECHO ALL STATHELP FILES WERE NOT COPIED TO DRIVE %2
@ECHO
@ECHO Try running SINSTALL again -- a few more times if necessary.
@ECHO If you continue to get this Error Message, consult the README.1ST
@ECHO file on the distribution disk for alternative install instructions.
GOTO END
:OOPS
IF EXIST %2\WATSTAT.EXE DEL %2\WATSTAT.EXE
IF EXIST %2\WATSTAT.TXT DEL %2\WATSTAT.TXT
IF EXIST %2\WATSTAT.HLP DEL %2\WATSTAT.HLP
IF EXIST %2\WATSTAT.INX DEL %2\WATSTAT.INX
IF EXIST %2\WATUT.EXE DEL %2\WATUT.EXE
IF EXIST %2\LOOKUP.EXE DEL %2\LOOKUP.EXE
IF EXIST %2\RANDO.EXE DEL %2\RANDO.EXE
IF EXIST %2\SHMANUAL.DOC %2\SHMANUAL.DOC
@ECHO
@ECHO
@ECHO INSUFFICIENT DISK SPACE ON DRIVE %2
@ECHO
@ECHO Drive %2 does not have the space required (about 470K bytes) to
@ECHO hold all the STATHELP files. If any files were copied to Drive %2,
@ECHO this install program has attempted to delete them, since they may
@ECHO have been corrupted. However, you should use DOS's DIR command to
@ECHO see if any STATHELP files remain on Drive %2. If so, delete them
@ECHO with DOS's ERASE or DEL commands.
@ECHO
GOTO END
:USAGE
@ECHO
@ECHO INSTRUCTIONS FOR RUNNING THE INSTALLATION BATCH FILE: SINSTALL.BAT
@ECHO
@ECHO First, go to the Drive you're installing FROM, by entering the appropriate
@ECHO Drive name, e.g, A:. Then run SINSTALL by typing a command with the
@ECHO following form:
@ECHO
@ECHO SINSTALL FROM_Drive TO_Drive TO_Directory
@ECHO
@ECHO For example, if you're installing FROM Drive A: and want to install
@ECHO TO Drive C: and TO a Directory called \STATHELP, you'd type:
@ECHO
@ECHO SINSTALL A: C: \STATHELP
@ECHO
@ECHO Always use a colon (:) after Drive letters and a backslash (\) preceding
@ECHO Directory names. If the TO_Directory doesn't exist, SINSTALL will create it.
@ECHO You may specify a Sub-Directory nested under one that already exists, e.g.,
@ECHO \UTILS\STATHELP, where \UTILS already exists. It's best to install TO a hard
@ECHO disk, but you may install TO a 3.5" or a High Density 5.25" floppy, if it has
@ECHO at least 470K bytes of free space. If you install TO a floppy, no TO_Directory
@ECHO name is needed: SINSTALL ignores directories for floppies and won't create any
@ECHO you specify. However, it always installs to a directory on a hard disk and,
@ECHO if you don't supply a name, it will use \STATHELP by default. If you install
@ECHO FROM a floppy, the FROM and TO drives must be different, e.g., installing FROM
@ECHO Drive A: TO Drive A: isn't allowed.
:END